﻿Imports System.Linq
Imports System.Data.Linq

Public Class ContRepository

    'Public dc As New TanNamChinhDataContext

    'Public Sub New()
    '    dc = GeneralClassDAL.dc
    'End Sub

    'Public Function SelectAllRecord() As IQueryable(Of tblCont)
    '    Dim query = From p In dc.tblConts
    '                    Select p

    '    Return query
    'End Function

    'Public Function SelectRecordById(ByVal id As Integer) As tblCont
    '    Dim query = dc.tblConts.SingleOrDefault(Function(p As tblCont) p.ID_Cont = id)
    '    Return query
    'End Function

    'Public Sub Insert(ByVal obj As tblCont)
    '    dc.tblConts.InsertOnSubmit(obj)
    '    dc.SubmitChanges()
    'End Sub

    'Public Sub Update(ByVal obj As tblCont)
    '    dc.Refresh(RefreshMode.KeepChanges, obj)
    '    dc.SubmitChanges(ConflictMode.ContinueOnConflict)
    'End Sub

    'Public Function SelectAllRecord(ByVal IsExport As Boolean) As IQueryable(Of tblCont)
    '    Dim query = From p In dc.tblConts
    '                    Select p
    '    Return query
    'End Function

    'Public Function SelectContsByTransport(ByVal id_file As Integer) As IQueryable
    '    Dim query = From p In dc.tblConts
    '                Where p.tblHBL.tblFileMBL.ID_File = id_file
    '                Select New With {p.ID_Cont, p.tblLineCont.ContNo, p.tblHBL.HBLNo, p.tblLineCont.tblContType.ContTypeName, p.Seal, p.GetEmptyContDate, p.DeliveryDate, p.tblGood.GoodName, p.tblDriver.DriverName}
    '    Return query
    'End Function
End Class
